<?php
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'set1';
$return=array();
$tabs=array(
    array('op'=>'set1','title'=>'销售条款'),
    array('op'=>'set2','title'=>'隐私政策'),
    array('op'=>'set3','title'=>'配送及退货'),
);
/*******basic*******/
if($_RQ['op']=='set1'){
    if($_RQ['postdata']){
        $postdata=get_postdata();
        $this->plugin_setting('tiaokuan1',$postdata);
        exi('设置成功');
    }
    $return['item']=$this->plugin_setting('tiaokuan1');
    $htmls=array(
        'type'=>'edit',
        'desc'=>'销售条款',
        'tabs'=>$tabs,
        'edit'=>array(
            array('type'=>'string','title'=>'标题','name'=>'title','help'=>''),
            array('type'=>'richtext','title'=>'内容','name'=>'content','help'=>''),
        ),
    );
    $return['htmls']=$htmls;
    exi($return);
}
if($_RQ['op']=='set2'){
    if($_RQ['postdata']){
        $postdata=get_postdata();
        $this->plugin_setting('tiaokuan2',$postdata);
        exi('设置成功');
    }
    $return['item']=$this->plugin_setting('tiaokuan2');
    $htmls=array(
        'type'=>'edit',
        'desc'=>'隐私政策',
        'tabs'=>$tabs,
        'edit'=>array(
            array('type'=>'string','title'=>'标题','name'=>'title','help'=>''),
            array('type'=>'richtext','title'=>'内容','name'=>'content','help'=>''),
        ),
    );
    $return['htmls']=$htmls;
    exi($return);
}
if($_RQ['op']=='set3'){
    if($_RQ['postdata']){
        $postdata=get_postdata();
        $this->plugin_setting('tiaokuan3',$postdata);
        exi('设置成功');
    }
    $return['item']=$this->plugin_setting('tiaokuan3');
    $htmls=array(
        'type'=>'edit',
        'desc'=>'配送及退货',
        'tabs'=>$tabs,
        'edit'=>array(
            array('type'=>'string','title'=>'标题','name'=>'title','help'=>''),
            array('type'=>'richtext','title'=>'内容','name'=>'content','help'=>''),
        ),
    );
    $return['htmls']=$htmls;
    exi($return);
}